package nc;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * 样例输出
 *
 * 输出123058789，函数返回值9
 *
 * 输出54761，函数返回值5
 *
 *
 *
 * 接口说明
 *
 * 函数原型：
 *
 *    unsignedint Continumax(char** pOutputstr,  char* intputstr)
 *
 * 输入参数：
 *    char* intputstr  输入字符串；
 *
 * 输出参数：
 *    char** pOutputstr: 连续最长的数字串，如果连续最长的数字串的长度为0，应该返回空字符串；如果输入字符串是空，也应该返回空字符串；
 *
 * 返回值：
 *   连续最长的数字串的长度
 */
public class Q21315 {

    public static Object[] continueMax(String old) {
        int i = 0;
        List<Integer> starts = new ArrayList<>();
        int length = 0;
        while (i < old.length()) {
            char c = old.charAt(i);
            int j = i+1;
            int subLength = 0;
            while (c >= '0' && c <= '9') {
                subLength ++;
                if (j == old.length()) {
                    break;
                }
                c = old.charAt(j);
                j ++;
            }
            if (subLength > length) {// 如何判断长度？
                length = subLength;
                starts.clear();
                starts.add(i);
            } else if (subLength == length && length != 0) {
                starts.add(i);
            }

            i = j;
        }
        return new Object[]{starts, length};
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            final String old = scanner.nextLine();
            final Object[] str = continueMax(old);
            List<Integer> starts = (List<Integer>) str[0];
            int length = (int) str[1];
            for (Integer start : starts) {
                System.out.print(old.substring(start, start + length));
                System.out.print(",");
            }
            System.out.print(length);
            System.out.println();
        }

    }

}
